package com.aizhixin.lab.project.course.entity;

import com.aizhixin.lab.project.template.entity.ProjectRole;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Data
@Entity(name = "c_module_task")
public class TeacherModuleTask {
    @Id
    @Column(name = "id")
    private String id;
    @Column(name = "module_id")
    private String moduleId;
    @Column(name = "task_name")
    private String taskName;
    @Column(name = "task_desc")
    private String taskDesc;
    @Column(name = "suggest_time")
    private Float suggestTime;
    @Column(name = "created_by")
    private Long createdBy;
    @Column(name = "created_date",insertable = false)
    private Date createdDate;
    @Column(name = "delete_flag")
    private Integer deleteFlag;
    @Column(name = "task_no")
    private Integer taskNo;
    @Column(name = "work_order_num")
    private Integer workOrderNum;
    @Column(name = "task_level")
    private Integer taskLevel;
    @Column(name = "task_step")
    private String taskStep;
    @ManyToMany(fetch = FetchType.EAGER)
    @JsonIgnoreProperties(value = { "teacherModuleTasks" })
    @JoinTable(name = "c_task_and_role",
            joinColumns = @JoinColumn(name = "task_id",referencedColumnName = "id"),
            inverseJoinColumns = @JoinColumn(name = "role_id",referencedColumnName = "id"))
    private List<ProjectRole> projectRoleList;
}
